
# 连接数据库操作

import pymysql

mydb = pymysql.connect(host="localhost",
                     user="root",
                     password="admin",
                     db="test",
                     use_unicode=True,
                     charset="utf8"
                     )
mycursor=mydb.cursor()


mycursor.execute("create table STU( id INT AUTO_INCREMENT PRIMARY KEY ,name varchar(20),class varchar(20))")

mydb.close()

